function validateForm() {
    var username = document.getElementById('username').value;
    var password = document.getElementById('password').value;
    if (username === "" || password === "") {
        alert("用户名和密码不能为空");
        return false;
    }
    return true;
}

document.addEventListener("DOMContentLoaded", function() {
    const inputs = document.querySelectorAll('.form-group input');
    inputs.forEach(input => {
        input.addEventListener('focus', function() {
            this.parentNode.classList.add('focused');
        });
        input.addEventListener('blur', function() {
            if (this.value === "") {
                this.parentNode.classList.remove('focused');
            }
        });
    });
});
